package com.study.mike.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.study.mike.model.dto.UserResourceNameDTO;
import com.study.mike.model.entity.ResourceDO;
import com.study.mike.model.po.GetUserRolePO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author KangHui
 * @Date 2022/7/15 9:54
 */
@Mapper
public interface ResourceMapper extends BaseMapper<ResourceDO> {

    /**
     * 获取资源树
     *
     * @param po
     * @return
     */
    List<ResourceDO> queryResource(@Param("po") GetUserRolePO po);

    /**
     * 获取资源名全路径-倒叙
     *
     * @param po
     * @return
     */
    List<UserResourceNameDTO> queryResourceName(@Param("po") GetUserRolePO po);


    /**
     * 获取资源名全路径-正序
     *
     * @param po
     * @return
     */
    List<UserResourceNameDTO> queryResourceNameAsc(@Param("po") GetUserRolePO po);

}
